package ${cfg.pojoPackage};

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * ${cfg.pojoPackage}.${cfg.tableCodeForClass} entity. 
 * file autogenerated by ThirdteenDevils's CodeGenUtil
 */
@Entity
@Table(name="${cfg.tableCode}")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class ${cfg.tableCodeForClass} implements java.io.Serializable {
	<#--  主键字段      -->
	//PK  ${cfg.pkColumn.columnDesc}
	@Id
	@GenericGenerator(name = "idGeneratorFor${cfg.tableCodeForClass}", strategy = "${cfg.generator}")  
	@GeneratedValue(generator = "idGeneratorFor${cfg.tableCodeForClass}")
	@Column(name="${cfg.pkColumn.columnCode}" <#if cfg.pkColumn.columnDataType=="varchar">,length=${cfg.pkColumn.columnDataLength}</#if>)
	private ${cfg.pkColumn.columnType} ${cfg.pkColumn.columnCodeForProperty};
	
	
	
	
	<#--  非主键字段      -->
<#list cfg.columnList as col> 
	//${col.columnDesc}
	//${col.columnDataType}
	<#if col.columnDataType=="date" >
	//@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
	</#if>
	<#if col.columnDataType=="datetime" >
	@Temporal(TemporalType.TIMESTAMP)
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	</#if>
	@Column(name="${col.columnCode}" <#if col.columnDataType=="varchar">,length=${col.columnDataLength}</#if>)
	private ${col.columnType} ${col.columnCodeForProperty};
	
</#list>







	
	<#--  主键字段setter getter  -->
	public void set${cfg.pkColumn.columnCodeForClass}(${cfg.pkColumn.columnType} ${cfg.pkColumn.columnCodeForProperty}){
		this.${cfg.pkColumn.columnCodeForProperty} = ${cfg.pkColumn.columnCodeForProperty};
	}
	public ${cfg.pkColumn.columnType} get${cfg.pkColumn.columnCodeForClass}(){
		return this.${cfg.pkColumn.columnCodeForProperty};
	}
	<#--  非主键字段setter getter  -->
<#list cfg.columnList as col> 
	public void set${col.columnCodeForClass}(${col.columnType} ${col.columnCodeForProperty}){
		this.${col.columnCodeForProperty} = ${col.columnCodeForProperty};
	}
	public ${col.columnType} get${col.columnCodeForClass}(){
		return this.${col.columnCodeForProperty};
	}
</#list>
	
	

}